package com.ycsd.invest.order.business.taskplugin;

import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.exception.KDException;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.schedule.executor.AbstractTask;
import kd.bos.servicehelper.BusinessDataServiceHelper;

import java.util.Map;

/**
 * @Descrіption:任务插件
 * @Author: yn
 * @Date: 2025/6/24 9:20
 */
public class TestTask extends AbstractTask {

    @Override
    public void execute(RequestContext requestContext, Map<String, Object> map) throws KDException {
        QFilter qFilter = new QFilter("billstatus", QCP.equals, "A");
        DynamicObject[] dynamicObjects = BusinessDataServiceHelper.load("ycsd_study_form",
                "id,billno", new QFilter[] {qFilter});
        System.out.println(dynamicObjects.length);
        map.put("size", dynamicObjects.length);
        //主动反馈进度，也可以不反馈
        feedbackProgress(1);

        //直接把输出参数返回去
        feedbackCustomdata(map);
    }

}
